<template>
  <view class="box">
    <!-- 我的发布 -->
    <view class="tou" :style="'padding-top:' + statusBarHeight1 + 'px'">
      <view class="imageview">
      	<image class="image1" @click="fanhui" src="https://pic.bangbangtongcheng.com/static/fanhui_bai.png" />
      </view>
	  <span>我的发布<span v-if="TabCur1 != 0 && activeData.length>0">({{activeData.length}})</span></span>
      <p @click="fanhui">{{text}}</p>
    </view>
    <view class="housCategory">
    	<view class="item" :class="index == TabCur ? 'clickCur' : ''" v-for="(item, index) in list"
    	  :key="index" @tap="tabSelect" :data-id="index">
    	  {{ item.name }}
    	  <image style="width: 40rpx;height: 20rpx;" src="https://pic.bangbangtongcheng.com/cdc093b7dd4845af9a26a90d66515e35" mode="widthFix" v-if="TabCur == index" />
    	</view>
    </view> 
    <!-- #ifdef H5 || APP-PLUS -->
	<!-- :style="'height: calc(100vh - '+curTop - safeBottom +'px );'"
	   -->
    <scroll-view scroll-y :style="
        'height:calc( 100vh - ' +
        statusBarHeight +
        'px - 96rpx - 96rpx - 98rpx )'
      "  class="scrollscroll" @scrolltolower="down" refresher-background="#f5f5f5" 
    @scroll="scroll">
      <!-- #endif -->
 
      <!-- #ifdef MP -->
	  <!-- :style="'height: calc(100vh - '+curTop - safeBottom +'px );'" -->
      <scroll-view scroll-y 
    @scroll="scroll"
	  :style="
	    'height:calc( 100vh - ' +
	    statusBarHeight + 
	    'px - 96rpx - 88rpx - 54rpx )'"
	  @scrolltolower="down" refresher-background="#f5f5f5">
        <!-- #endif -->
        <view class="list" :style="width == 290?'padding-bottom:130rpx':''">
          <view class="li" v-for="(item, index) in Recommend" :key="index" @touchstart="slideBegan" @touchmove="inSlide" @touchend="endSlide" :data-target="'move-box-' + index">
            <radio v-if="width == 290" style="top: -47px; margin-right: 10px;" :data-index='index' :checked="item.active"
              class="radioA" @click="changeRadio">
            </radio>
            <!-- <radio v-if="width == 290 && item.STATUS==1" style="top: -47px; margin-right: 10px" :data-index='index'
              disabled class="radioA">
            </radio> -->
            <view class="xian" :style="'width: ' + (width + 324) + 'rpx'"></view>

            <image mode="aspectFit" class="img1" :src="item.display_diagram?item.display_diagram:imgUrl + item.house_image" @click="details(item)" />
            <template v-if="item.examine_status == 2">
              <view class="biaoqian1" :style="width == 290 ? 'left:72rpx' : 'left:0rpx'" v-if="item.up_status == 1 && identify !== 6">已上架
              </view>
			  
              <view class="biaoqian2" :style="width == 290 ? 'left:72rpx' : 'left:0rpx'" v-if="item.up_status == 0">未上架
              </view>
			  <view class="biaoqian1" :style="width == 290 ? 'left:72rpx' : 'left:0rpx'" v-if="item.is_share == 1 && identify == 6">已共享
			  </view>
			  <view class="biaoqian1" :style="width == 290 ? 'left:72rpx' : 'left:0rpx'" v-if="identify == 4">已申领
			  </view>
			  <view class="biaoqian2" :style="width == 290 ? 'left:72rpx' : 'left:0rpx'" v-if="item.is_share == 2">已撤回
              </view>
			  <view class="biaoqian2" :style="width == 290 ? 'left:72rpx' : 'left:0rpx'" v-if="item.del_flag == 1">已删除
              </view>
			  
              <image class="img2" v-if="item.STATUS == 1 && item.transaction_type == 2"
                :style="width == 290 ? 'left:72rpx' : 'left:0rpx'"
                src="https://pic.bangbangtongcheng.com/static/shou.png" @click="details(item)"/>
              <image class="img3" v-if="item.STATUS == 1 && item.transaction_type == 1"
                :style="width == 290 ? 'left:72rpx' : 'left:0rpx'"
                src="https://pic.bangbangtongcheng.com/static/zu.png" @click="details(item)"/>
            </template>
            <image class="img3" :style="width == 290 ? 'left:72rpx' : 'left:0rpx'"
              src="https://pic.bangbangtongcheng.com/static/shenhe.png" v-if="item.examine_status == 1 && TabCur1!=3" />
            <view class="li_1" @click="details(item)" :style="'width: ' + width + 'rpx'">
              <view class="tit">{{ item.title }}</view>
			  <view class="neirong_1" v-if="TabCur1!=3">
			  	<view class="neir_css">{{ item.region }}</view>
			  	<view class="neir_css">{{ item.cell_name || ''}}</view>
			  </view>
			  <view class="neirong_1" v-if="TabCur1!=3">
			  	<view class="neir_css">{{item.house_type || ''}}</view>
			  </view>
			  <view class="neirong_1" v-if="TabCur1!=3">
			    <view class="price neir_css" v-if="item.transaction_type == 2">{{ item.price }}万</view>
			    <view class="price neir_css" v-if="item.transaction_type == 1 && item.price <= 10000">{{ item.price }}元</view>
			    <view class="price neir_css" v-if="item.transaction_type == 1 && item.price > 10000">{{ item.price/10000 }}万元</view>
			    <view class="neir_css" style>{{ item.AREA || item.area }}㎡</view>
			  </view>
            </view>
			<view class="HousCondition">
				<text style="border-bottom: 1px solid #64B6A8;color: #64B6A8;"></text>
				<view class="status">
					<view class="item" v-if="item.up_status == 1">已上架</view>
					<view class="item" v-if="item.up_status == 0">已下架</view>
					<view class="item" v-if="item.STATUS == 1">已租售</view>
					<!-- <view class="item">已共享</view> -->
					<view class="item" v-if="item.is_share == 1">已共享</view>
					<view class="item" v-if="item.del_flag == 1">已删除</view>
					<view class="item" v-if="item.is_share == 2">已撤回</view>
					<!-- <view class="item" v-if="item.is_show == 1">已置顶</view> -->
					<img @click="del(item)" style="width: 50rpx;height:50rpx;margin-left: 20rpx;" src="https://pic.bangbangtongcheng.com/cf645aeb155c4005adb022f3d3e98bae">
				</view>
			</view>
			<view :class="personalLetter == 'move-box-' + index ? 'noSlide' : 'endSlide'" class="youhua" @touchend.stop="">
				<view @click.stop="del(item)" style="width: 141rpx;height: 118rpx;background-color: #EA4B4B;border-radius: 6rpx;display: flex;align-items: center;justify-content: center;">
					<img src="https://pic.bangbangtongcheng.com/fe44a1005d7941cea087d4bae0f9c6d2" style='width: 40rpx;height: 40rpx;'>
					<text style="color: #fff;font-size: 30rpx;margin-left: 10rpx;">删除</text>
				</view>
			</view>
			<view class="sharer-say flex" :style="'width: ' + (width + 324) + 'rpx'" v-if="identify == 6 || (identify == 4 && item.commission)">
				<text style="color:#999">共享者说:
          <text style="color: #333;margin-left:10rpx"> 
            佣金
            <text v-if="item.isFace != 1"> {{ item.commission }}元</text>
            <text v-if="item.isFace == 1"> 面议</text>
          </text>
        </text> 
				<view class="flex" @click="openShareTips(item)">
					展开 <u-icon name="arrow-down" color="#64b6a8" size="14"></u-icon>
				</view>
			</view>
          </view>
          <view v-if="Recommend.length == 0" class="none">
            <image src="https://pic.bangbangtongcheng.com/static/none.png" mode="widthFix" />
            <view>没有更多数据了</view>
          </view>
          <view class="down" v-show="Recommend.length != 0 && !downStatus">
            没有更多了
          </view>
        </view>
      </scroll-view>

      <view class="bottomOperation" v-if="width == 290">
       <!-- <view class="bot_1" style="margin-right: 20rpx;" @click="del">删除</view>
		<view class="bot_2" @click="refresh" v-if="TabCur1==1">刷新</view>
        <template v-if="TabCur1 ==1">
          <view class="bot_2">置顶至</view>
				<view class="bot_3" >
						<picker
							@change="PickerChange"
							data-type="4"
							range-key="valueName"
							:range="type4"
						>
							<view class="picker" style="color:#64B6A8" v-if="typeIndex4 != -1">{{
								type4[typeIndex4].valueName
							}}</view>
							<view class="picker" style="color: #666" v-else>请选择</view>
						</picker>
				</view>
          <view class="bot_4">
            <picker @change="PickerChange" data-type="6" range-key="valueName" :range="type6">
              <view class="picker" style="color: #fff" v-if="typeIndex6 != -1">{{type6[typeIndex6].valueName}}</view>
              <view class="picker" style="color: #fff" v-else>请选择</view>
            </picker>
            <text v-if="activeData.up_status == 1">下架</text>
			<text v-if="activeData.up_status == 0">上架</text>
			<text v-if="!activeData.up_status && activeData.up_status != 0">请选择</text>
          </view>
        </template> -->
		<view class=""></view>
		<view class="" style="display: flex;" v-if="identify==2">
			<view class="item" @click='houseAvailableChange(0)'>上架</view>
			<!-- <view class="item" @click='houseAvailableChange(4)'>置顶</view> -->
			<view class="item" @click='houseAvailableChange(2)'>已租售</view>
		</view>
		<view class="" style="display: flex;" v-else-if="identify==1">
			<!-- <view class="item" @click='houseAvailableChange(4)'>置顶</view> -->
			<view class="item" @click='houseAvailableChange(2)'>已租售</view>
			<view class="item" @click='houseAvailableChange(1)'>下架</view>
			<view class="item" @click='houseAvailableChange(3)'>刷新</view>
		</view>
		<view class="" style="display: flex;" v-else-if="identify==5">
			<view class="item" @click='houseAvailableChange(0)'>上架</view>
			<view class="item" @click='houseAvailableChange(1)'>下架</view>
			<!-- <view class="item" @click='houseAvailableChange(4)'>置顶</view> -->
			<view class="item" @click='houseAvailableChange(3)'>刷新</view>
		</view>
		<view class="" style="display: flex;" v-else-if="identify==4">
			<view class="item" @click='houseAvailableChange(0)'>上架</view>
			<view class="item" @click='houseAvailableChange(1)'>下架</view>
			<!-- <view class="item" @click='houseAvailableChange(4)'>置顶</view> -->
			<view class="item" @click='houseAvailableChange(3)'>刷新</view>
		</view>
		<view class="" style="display: flex;" v-else-if="identify==3">
			<view class="item" @click='houseAvailableChange(2)'>已租售</view>
			<view class="item" @click='houseAvailableChange(0)'>上架</view>
			<view class="item" @click='houseAvailableChange(1)'>下架</view>
			<!-- <view class="item" @click='houseAvailableChange(5)'>取消置顶</view> -->
			<view class="item" @click='houseAvailableChange(3)'>刷新</view>
		</view>
		<view class="" style="display: flex;" v-else-if="identify==6">
			<view class="item" @click='houseAvailableChange(6)'>撤回共享</view>
			<!-- <view class="item" @click='houseAvailableChange(5)'>取消置顶</view> -->
			<view class="item" @click='houseAvailableChange(3)'>刷新</view>
		</view>
      </view>
      <view class="zbc" v-if="zbc">
        <view class="tan" v-if="shouye">
          <view class="li_1">置顶信息：{{activeData.length==1?activeData[0].title:'您选择了多套房源'}}</view>
          <view class="li_2">
            <view>置顶天数：</view>
            <view class="xuan">
              <picker @change="PickerChange" data-type='1' :range="picker">
                <view class="picker" style="color: #64B6A8" v-if="typeIndex1 != -1">{{
              picker[typeIndex1]
            }}</view>
                <view class="picker" style="color: #64B6A8;font-size:24rpx" v-else>请选择</view>
              </picker>
            </view>
          </view>
          <view class="li_3">平台规则：每天限定置顶20条次，置顶信息按时间排序</view>
          <view class="li_4" @click='guan'>取消</view>
          <view class="li_5" @click='zhiding'>确定</view>
        </view>
        <view class="shangjia" v-if="shangjia">
          <view class="li_1" v-if="typeIndex6 == 0">确定要上架当前房源吗？</view>
          <view class="li_1" v-if="typeIndex6 == 1">确定要下架当前房源吗？</view>
          <view class="li_1" v-if="typeIndex6 == 2">确定要标记为已租售？</view>
          <view class="li_1" v-if="typeIndex6 == 3">确定要标记为已租售？</view>
          <view class="li_2" @click="guan">取消</view>
          <view class="li_3" @click="shangjiaF">确定</view>
        </view>
      </view>
	  
	  <view class="zbc" v-if="zbc1">
	  	<view class="sharer-tips" v-if="showShareTips">
	  		<view class="tips-top flex">
	  			<text>共享者说:</text>
	  		</view>
	  			<view class="tips-content">
	  				<view class="yong-jin flex">
	  					佣金:  <view class="">
	  					 {{houseDetails.commission}}元
	  					</view>
	  					
	  				</view>
	  				<view class="yong-jin flex">
	  					<text>备注:  </text>
	  					<view>{{houseDetails.share_remark}} </view>
	  				</view>
	  			</view>
	  			<view class="tips-btn" @click="closeTips">
	  				确定
	  			</view>
	  	</view>
	  </view>
	<uniBall></uniBall>
  </view>
</template>
<script>
  import {
    mapGetters
  } from "vuex";
  let statusBarHeight;
  //#ifdef H5
  import wxshare from "../utils/index.js";
  statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 10;
  //#endif
  // #ifdef APP-PLUS
  statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 10;
  //  #endif
  // #ifdef MP-WEIXIN
  statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 5;
  //  #endif
  export default {
    computed: {
      ...mapGetters(["statusBarHeight1", "userinfo"]),
    },
    data() {
      return {
        statusBarHeight,
        width: 290,
        text: "完成",
        TabCur: 0,
        TabCur1: 1,
        zbc: false,
		zbc1: false,
        shouye: false,
        shangjia: false,
        redioCheck: "",
        list: [{
            num: 1,
            name: "全部"
          },
          {
            num: 2,
            name: "新房"
          },
          {
            num: 3,
            name: "二手房"
          },
          {
            num: 4,
            name: "出租房"
          },
        ],
        list1: [
			{
			  num: 2,
			  name: "已通过"
			},
		  {
            num: 1,
            name: "待审核"
          },
          {
            num: 3,
            name: "已拒绝"
          },
		  {
		    num: 4,
		    name: "草稿箱"
		  },
        ],
        typeIndex1: -1,
        type4: [{
            valueName: "首页",
            id: "1",
          },
          {
            valueName: "房源信息",
            id: "",
          },
        ],
        typeIndex4: -1,
        type6: [{
            valueName: "上架",
            id: "1",
          },
          {
            valueName: "下架",
            id: "2",
          },
          {
            valueName: "已出租",
            id: "3",
          },
          {
            valueName: "已出售",
            id: "4",
          },
        ],
        typeIndex6: -1,
        scrollLeft: 0,
        scrollLeft1: 0,
        picker: [],
        pageSize: 10,
        pageNo: 1,
        trigger: false,
        downStatus: true,
        upStatus: true,
        userInfo: uni.getStorageSync("Pduser"),
        imgUrl: this.$imgSrc,
        Recommend: [],
        transactionType: "",
        newOld: "",
        activeData: [],
        examineStatus: 2,
		curTop:0,
		safeBottom:0,
		// 上架房源套数
		onHousing:10,
		identify:-1,
		personalLetter:null,
		personalHideLeft:0,
		hideLeft:0,
		showShareTips: false,
		zbc:false,
      };
    },
    onLoad(e) {
      for (let i = 1; i < 11; i++) {
        this.picker.push(i + "天");
      }
	  this.identify=e.identify
	  this.getFy();
	  /* #ifdef H5 */
	  this.jinzhi();
	  /* #endif */
      
    },
	onShow() {
		
	},
    async onPullDownRefresh() {
      this.Recommend = [];
      this.pageNo = 1;
      this.downStatus = true;
      if (this.upStatus) {
        this.trigger = true;
        await this.getFy();
      }
    },
    filters: {
      nums(val) {
        return val.toFixed(2);
      },
    },
    methods: {
		openShareTips(val){
			  this.houseDetails = val;
			  this.zbc1 = true;
			  this.showShareTips = true;
		  },		
			
		closeTips(){
			this.zbc1 = false;
			this.showShareTips = false;
		},	
		// 通过房源操作
		houseAvailableChange(e){
			if (this.activeData.length==0) {
				uni.showToast({
				  title: "请选择房源",
				  icon: "none",
				  mask: true
				});
				return;
			}
			if (e==0) {
				this.typeIndex6 = 0;
				this.zbc = true;
				this.shangjia = true;
			}else if(e==1){
				this.typeIndex6 = 1;
				this.zbc = true;
				this.shangjia = true;
			}else if(e==2){
				if (this.activeData[0].transaction_type==1) {
					this.typeIndex6 = 2;
				}else if(this.activeData[0].transaction_type==2){
					this.typeIndex6 = 3;
				}
				this.zbc = true;
				this.shangjia = true;
			}else if(e==3){
				// 刷新
				this.refresh()
			}else if(e==4){
				// 置顶
				this.zbc = true;
				this.shouye = true;
			}else if(e==5){
				// 取消置顶
				this.cancelzZhiding()
			}else if(e==6){
				// 撤回共享
				this.cancleShare()
			}
		},
		
		// 撤回共享
		cancleShare(){
			var idList = [];
			for (var i = 0; i < this.activeData.length; i++) {
				idList.push(this.activeData[i].id);
			}
			var ids = idList.join(",");
			uni.showModal({
			  title: "",
			  content: "确定撤回共享房源吗？",
			  showCancel: true,
			  success: (res) => {
			    if (res.confirm) {
			     this.$myRequest
			       .post("/mob/iteration/shareHouseInfo", {
			         id: ids, 
			         userId: this.userInfo.id,
			         isShare:0,
			       })
			       .then((res) => {
			         uni.showToast({
			           title: res.msg,
			           icon: "none",
			         });
			         setTimeout(() => {
			           this.reload();
			         }, 1000);
			       });
			    }
			  },
			});
		},
		
		slideBegan(e){
			console.log('滑动了')
			this.touchStart = e.touches[0].pageX;
		},
    scroll() {
			this.touchDirection = null;
      this.personalLetter = null;
    },
		inSlide(e){
			this.touchDirection =e.touches[0].pageX - this.touchStart > 0 ? "right" : "left";
		},
		endSlide(e){
			if (this.touchDirection == "left") {
				this.hideLeft = '1'
				this.personalLetter = e.currentTarget.dataset.target;
			} else {
				this.personalLetter = null;
			}
			this.touchDirection = null;
			console.log(this.personalLetter)
		},
		// 跳转房源管理
		HousManagement(){
			uni.navigateTo({
			  url: "/pages_my/housManagement"
			});
		},
		// 搜索
		search(){
			if (!this.userinfo.phone) {
			  uni.showToast({
			    title: "请登录",
			    icon: "none",
			    mask: true
			  });
			  return;
			}
			uni.navigateTo({
			  url: "/pages_search/search?searchlogType=1"
			});
		},
		// 管理
		administration(){
			this.administrationClose = !this.administrationClose
		},
      bianji() {
   //      if (this.text == "编辑") {
			// this.Recommend.forEach(v=>{
			// 	v.active=false
			// })
			// this.activeData=[]
   //        this.text = "完成";
   //        this.width = 290;
   //      } else {
   //        this.text = "编辑";
   //        this.width = 366;
   //      }
      },
      jinzhi() {
        let _this = this;
        let param = window.location.href.split("#")[0];
        uni.request({
          method: "post",
          data: {
            url: param
          },
          header: {
            "content-type": "application/x-www-form-urlencoded",
          },
          url: "https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do",
          success(re) {
            _this.jinzhifx(re.data);
          },
        });
      },
      jinzhifx(data) {
        wxshare.config({
          debug: false, //是否打开调试
          appId: data.appId, // 公众号的唯一标识
          timestamp: data.timestamp, // 生成签名的时间戳
          nonceStr: data.nonce, // ，生成签名的随机串
          signature: data.signature, // 签名
          jsApiList: ["hideMenuItems"],
        });
        // 禁止分享
        wxshare.hideMenuItems({
          // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
          menuList: [
            "menuItem:share:appMessage",
            "menuItem:share:timeline",
            "menuItem:share:timeline",
            "menuItem:share:qq",
            "menuItem:favorite",
            "menuItem:share:QZone",
            "menuItem:openWithSafari",
          ],
        });
      },
      tabSelect1(e) {
        console.log(e);
        this.TabCur1 = e.currentTarget.dataset.id;
        this.scrollLeft1 = (e.currentTarget.dataset.id - 1) * 60;
        this.examineStatus = e.currentTarget.dataset.id + 1;
        this.text = "编辑";
        this.width = 366;
        this.Recommend = [];
        this.activeData = []
        this.pageNo = 1;
        this.upStatus = true;
        this.trigger = false;
        this.getFy();
      },
      tabSelect(e) {
        this.TabCur = e.currentTarget.dataset.id;
        this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
        let num = e.currentTarget.dataset.id + 1;
        if (num == 1) {
          this.transactionType = "";
          this.newOld = "";
        } else if (num == 2) {
          this.transactionType = "2";
          this.newOld = "1";
        } else if (num == 3) {
          this.transactionType = "2";
          this.newOld = "2";
        } else if (num == 4) {
          this.transactionType = "1";
          this.newOld = "";
        }
        this.Recommend = [];
        this.activeData = [];
        this.pageNo = 1;
        this.upStatus = true;
        this.trigger = false;
        this.personalLetter = null;
        this.getFy();
      },
      changeRadio(e) {
        let that = this;
        let index = e.currentTarget.dataset.index;
        this.typeIndex6 = -1;
        if (that.Recommend[index].active) {
          that.Recommend[index].active = !that.Recommend[index].active;
          var index0 = this.activeData.findIndex((item) => {
            if (that.Recommend[index].id == item.id) {
              return true;
            }
          });
          this.activeData.splice(index0, 1);
          console.log(that.activeData);
        } else {
          that.Recommend.forEach((el, index1) => {
            if (index1 == index) {
				var redioCheck = false;
				// for (var i = 0; i < that.activeData.length; i++) {
				// 	if (
				// 		that.Recommend[index1].transaction_type != this.activeData[i].transaction_type
				// 	) {
				// 		redioCheck = true;
				// 	  }
    //           }
              if (redioCheck) {

                uni.showToast({
                  title: "只能选择相同状态的数据！",
                  icon: "none",
                  mask: true,
                });
                setTimeout(() => {
                  that.reload();
                }, 1000);
                return;
              } else {
                that.Recommend[index1].active = !that.Recommend[index1].active;
                that.activeData.push(that.Recommend[index1]);
              }

              console.log(that.activeData);
            } else {
              // that.Recommend[index1].active = false;
            }
          });
        }
      },
      del(item) {
        let that = this;
        uni.showModal({
          title: "",
          content: "确定删除此房源？",
          showCancel: true,
          success: (res) => {
            if (res.confirm) {
              that.$myRequest
                .post("/mob/user/delHouseInfo", {
                  ids: item.id,
                })
                .then((res) => {
                  this.activeData = []
                  uni.showToast({
                    title: res.msg,
                    icon: "none",
                    mask: true,
                  });
				  this.personalLetter=null
                  setTimeout(() => {
                    that.reload();
                  }, 1000);
                });
            }
          },
        });
      },
	  // 刷新
	  refresh(){
		  let that = this;
		  let idList = [];
		  that.activeData.forEach(v=>{
			  idList.push(v.id)
		  })
		  if (!idList.length) {
		    uni.showToast({
		      title: "请选择房源",
		      icon: "none",
		      mask: true,
		    });
		    return;
		  }
		  that.$myRequest
		    .post("/mob/home/refresh", {
		      id: idList.join(','),
		    })
		    .then((res) => {
		      uni.showToast({
		        title: res.msg,
		        icon: "none",
		        mask: true,
		      });
		      setTimeout(() => {
		        that.reload();
		      }, 1000);
		    });
	  },
      shangjiaF() {
        var idList = [];
        for (var i = 0; i < this.activeData.length; i++) {
          idList.push(this.activeData[i].id);
        }
        var ids = idList.join(",");
        this.$myRequest
          .post("/mob/home/updateUpStatus", {
            id: ids,
            userId: this.userInfo.id,
            upStatus: this.typeIndex6 + 1,
          })
          .then((res) => {
            this.activeData = []
            uni.showToast({
              title: res.msg,
              icon: "none",
            });
            this.guan();
            setTimeout(() => {
              this.reload();
            }, 1000);
          });
      },
      zhiding() {
		  if (Number(this.typeIndex1) + 1<=0) {
		  	uni.showToast({
		  	   title: '请选择天数',
		  	   icon: "none",
		  	});
		  	return
		  }
		  var idList = [];
		  for (var i = 0; i < this.activeData.length; i++) {
		    idList.push(this.activeData[i].id);
		  }
		  var ids = idList.join(",");
        this.$myRequest
          .post("/mob/home/updateUpHomePage", {
            id: ids,
            dayNum: Number(this.typeIndex1) + 1,
            // isShow: this.type4[this.typeIndex4].id,
      		isShow:'1'
          })
          .then((res) => {
            uni.showToast({
              title: res.msg,
              icon: "none",
            });
            this.guan();
            setTimeout(() => {
              this.reload();
            }, 1000);
          });
      },
      // 取消置顶
      cancelzZhiding() {
		var idList = [];
		for (var i = 0; i < this.activeData.length; i++) {
			idList.push(this.activeData[i].id);
		}
		var ids = idList.join(",");
      	uni.showModal({
      	  title: "",
      	  content: "确定取消该房源置顶吗？",
      	  showCancel: true,
      	  success: (res) => {
      	    if (res.confirm) {
      	     this.$myRequest
      	       .post("/mob/home/updateUpHomePage", {
					id: ids,
      	      		isShow:'0'
      	       })
      	       .then((res) => {
      	         uni.showToast({
      	           title: res.msg,
      	           icon: "none",
      	         });
      	         setTimeout(() => {
      	           this.reload();
      	         }, 1000);
      	       });
      	    }
      	  },
      	});
      },
      getFy() {
        let that = this;
        this.upStatus = false;
		let identifys=0
		let status=''
		let isShow=''
		let isCopy=''
		let isShare=''
		if (this.identify==1) {
			identifys=1
			status='0,1'
			isShow=''
			isCopy=''
		}else if (this.identify==2) {
			identifys=0
			status='0,1'
			isShow=''
			isCopy=''
		}else if (this.identify==3) {
			identifys=''
			status='0,1'
			isShow='1'
			isCopy=''
		}else if (this.identify==4) {
			identifys=''
			status='0,1'
			isShow=''
			isCopy='1'
		}else if(this.identify==5){
			identifys=''
			status='1'
			isShow=''
			isCopy=''
		}else if(this.identify==6){
			identifys=''
			status='0,1'
			isShow=''
			isCopy=''
			isShare= 1
		}
        this.$myRequest
          .get("/mob/home/getHouseInfo", {
            pageSize: this.pageSize,
            pageNo: this.pageNo,
            userId: this.userInfo.id,
            transactionType: this.transactionType,
            newOld: this.newOld,
			upStatus:identifys,
            examineStatus: this.examineStatus,
            isLz: '0',
            status: status,
			orderSort:'1',
			isShow:isShow,
			isCopy:isCopy,
			isShare
            // shopId: this.userInfo.shopId
          })
          .then((res) => {
            if (!res.list.length) {
              that.downStatus = false;
            }
            this.upStatus = true;
            this.trigger = false;
            res.list.forEach((el) => {
				el.active=false

				if (el.house_image) {
					el.house_image = el.house_image.split("|")[0];
				}
				if (el.hasOwnProperty("FLOOR")) {
				   if (el.FLOOR.indexOf('|')!=-1) {
						el.floors=el.FLOOR.split('|')[0]+'层/共'+el.FLOOR.split('|')[1]+'层'
				   }else {
						el.floors = "";
				   }
				}
            });
			// this.activeData=[]
            // this.Recommend = res.list.concat(res.list)
            this.Recommend = this.Recommend.concat(res.list);
			console.log(this.Recommend,'房源数据')
            uni.stopPullDownRefresh();
			this.$nextTick(function(){
				uni.createSelectorQuery().in(this).select('.scrollscroll').boundingClientRect(result => {
					console.log('result',result)
				   if (result) { 
					   that.curTop=result.top
				    
				   }
				  }).exec(); 
			})
            // this.userInfo = res.userInfo;
            // uni.setStorageSync("Pduser", res.userInfo);
          });
      },
      reload() {
        this.Recommend = [];
        // this.activeData = [];
        this.pageNo = 1;
        this.upStatus = true;
        this.trigger = false;
		this.activeData=[];
        this.getFy();
      },
      down() {
        if (this.downStatus) {
          console.log(1111111111);
          this.pageNo++;
          this.getFy();
        }
      },
      shangjiaC() {
        this.zbc = true;
        this.shangjia = true;
      },
      async up() {
        this.Recommend = [];
        this.pageNo = 1;
        this.downStatus = true;
        if (this.upStatus) {
          this.trigger = true;
          await this.getFy();
        }
      },
      details(item) {
		if (this.hideLeft == 1) {
		  	this.hideLeft = '0';
		  	return
		}
		if (this.TabCur1==3 || this.TabCur1==2) {
		  	let items=JSON.stringify(item)
		  	uni.setStorageSync('editData',items)
			if (item.transaction_type==1) {
				uni.navigateTo({
					url: '/pages_release/tenement'
				});
			}else{
				uni.navigateTo({
					url: '/pages_release/index'
				});
			}
			return
		}
        if (this.TabCur1==1) {
			if(item.is_share == 2) {
				uni.showToast({
				    title: "该房源已撤回",
				    icon: "none",
				    mask: true
				});
				return
			}
			if(item.del_flag == 1) {
				uni.showToast({
				    title: "该房源已删除",
				    icon: "none",
				    mask: true
				});
				return
			}
        	uni.navigateTo({
        	  url: `./shareHouseDetails?id=${item.id}&identify=${this.identify}` ,
        	});
        }
      },
      fanhui() {
        uni.navigateBack({
          delta: 1,
        });
      },
      PickerChange(e) {
        // console.log(e);
        if (this.activeData.length == 0) {
          uni.showToast({
            title: "请选择房源",
            icon: "none",
          });
          return;
        }
        let index = e.detail.value;
        let type = e.currentTarget.dataset.type;
        if (type == 4) {
          this.typeIndex4 = index;
          this.zbc = true;
          this.shouye = true;
        } else if (type == 6) {
          this.typeIndex6 = index;
          console.log(this.typeIndex6);
          this.zbc = true;
          this.shangjia = true;
        } else if (type == 1) {
          this.typeIndex1 = index;
        }
      },
      guan() {
        this.zbc = false;
        this.shouye = false;
        this.shangjia = false;
      },
	  goJuBao(){
	  	uni.navigateTo({
	  		url:`/pages_houses/housing/informer?id=${this.houseDetails.user_id}&houseId=${this.houseDetails.id}`
	  	})
	  },	
    },
  };
</script>
<style lang="less" scoped>
	/deep/ uni-radio:not([disabled]) .uni-radio-input:hover{
		border-color:#d1d1d1;
	}
	/deep/ radio .uni-radio-input{
		margin: 0;
		width: 48rpx;
		height: 48rpx;
	}
	
	.zbc {
	  position: fixed;
	  width: 100%;
	  top: 0;
	  bottom: 0;
	  background-color: rgba(0, 0, 0, 0.3);
		.sharer-tips{
			position: absolute;
			// padding: 30rpx0;
			width: 600rpx;
			// height: 310rpx;
			background-color: #fff;
			top: 30%;
			left: 50%;
			transform: translateX(-50%);
			border-radius: 10rpx;
			.tips-top{
				padding: 45rpx 35rpx 20rpx;
				
				display: flex;
				justify-content: space-between;
				align-items: center;
			}
			.tips-content{
				padding: 0 35rpx;
				.yong-jin{
					margin-bottom: 10rpx;
					align-items: flex-start;
					flex-wrap: wrap;
					view{
						margin-left: 10rpx;
						width: 400rpx;
						word-wrap:break-word;word-break: break-all; 
						word-break:break-all; 
					}
				}
			}
			.tips-btn{
				width: 100%;
				padding: 30rpx 0;
				margin-top: 40rpx;
				text-align: center;
				background-color: #64b6a8;
				color: #fff;
			}
		}
	}
	
	.sharer-say{
			  justify-content: space-between;
			  align-items: center;
			  margin-left: 72rpx;
			  text{
				  width: 400rpx;
				  // flex: 11;
				  white-space: nowrap;
				  overflow: hidden;
				  text-overflow: ellipsis;
			  }
			  view{
				  // flex: 1;
				  padding: 10rpx;
				  color: #64b6a8;
			  }
	} 
  .zbc {
    position: fixed;
    width: 100%;
    top: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 99;

    .tan {
      position: absolute;
      width: 600rpx;
      height: 420rpx;
      background-color: #fff;
      top: 30%;
      left: 50%;
      transform: translateX(-50%);
      border-radius: 10rpx;
      overflow: hidden;

      .li_1 {
        margin-left: 32rpx;
        margin-top: 60rpx;
        font-weight: 600;
        font-size: 30rpx;
      }

      .li_2 {
        font-size: 30rpx;
        margin-left: 32rpx;
        margin-top: 30rpx;

        view {
          display: inline-block;
          font-weight: 600;
          font-size: 30rpx;
        }

        .xuan {
          position: relative;
          width: 160rpx;
          height: 60rpx;
          background: #ffffff;
          border: 2rpx solid #64b6a8;
          border-radius: 37rpx;
          line-height: 60rpx;
          color: #64b6a8;
          text-indent: 16rpx;
        }

        .xuan::before {
          position: absolute;
          top: 20rpx;
          right: 30rpx;
          content: "";
          border-color: #fff #fff #64b6a8 #fff;
          border-style: solid;
          border-width: 0rpx 8rpx 14rpx 8rpx;
          height: 0;
          width: 0;
        }
      }

      .li_3 {
        width: 536rpx;
        font-size: 24rpx;
        margin-left: 32rpx;
        color: #ea4b4b;
        margin-top: 40rpx;
      }

      .li_4 {
        position: absolute;
        font-size: 30rpx;
        width: 300rpx;
        height: 90rpx;
        background: #f2f2f2;
        bottom: 0;
        left: 0;
        text-align: center;
        line-height: 90rpx;
      }

      .li_5 {
        position: absolute;
        font-size: 30rpx;
        width: 300rpx;
        height: 90rpx;
        background: #64b6a8;
        bottom: 0;
        right: 0;
        text-align: center;
        line-height: 90rpx;
        color: #fff;
      }
    }
	
    .shangjia {
      position: absolute;
      width: 600rpx;
      height: 300rpx;
      background-color: #fff;
      border-radius: 10rpx;
      top: 30%;
      left: 50%;
      transform: translateX(-50%);

      .li_1 {
        width: 100%;
        font-size: 34rpx;
        font-weight: 600;
        margin-left: 114rpx;
        margin-top: 80rpx;
      }

      .li_2 {
        display: inline-block;
        vertical-align: top;
        width: 160rpx;
        height: 60rpx;
        background: #ffffff;
        border: 2rpx solid #64b6a8;
        border-radius: 37rpx;
        text-align: center;
        line-height: 60rpx;
        color: #64b6a8;
        margin-top: 58rpx;
        margin-left: 118rpx;
      }

      .li_3 {
        display: inline-block;
        vertical-align: top;
        width: 160rpx;
        height: 60rpx;
        background: #64b6a8;
        border-radius: 37rpx;
        text-align: center;
        line-height: 60rpx;
        color: #fff;
        margin-top: 58rpx;
        margin-left: 46rpx;
      }
    }
  }
	.noSlide{
		transform: translateX(0rpx);
		transition: 0.5s;
	}
	.endSlide{
		transform: translateX(190rpx);
	}
	.youhua{
		width: 184rpx;
		height: 216rpx;
		position: absolute;
		top: 0;
		right: -4%;
		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
	}
  .box {
    width: 100%;
    // padding-bottom: 130rpx;
    background-color: #fff;
  }

  .tou {
    position: relative;
    width: 100%;
    // height: 88rpx;
    text-align: center;
    line-height: 88rpx;
    font-size: 36rpx;
    color: #fff;
    background-color: #64b6a8;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 30rpx;
	// #ifdef MP-WEIXIN
	padding-right: 210rpx;
	// #endif
	.imageview{
		width: 100rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		.image1 {
			width: 32rpx;
			height: 32rpx;
		}
	}
    p {
		width: 100rpx;
      font-size: 32rpx;
      color: #fff;
    }
  }
  .auditCheck{
	  width: 750rpx;
	  height: 100rpx;
	  display: flex;
	  align-items: center;
	  border-bottom:1px solid #e6f0ed;
	  .item{
		  flex: 1;
		  display: flex;
		  justify-content: space-between;
		  align-items: center;
		  padding: 0 30rpx;
		  text{
			  font-size: 32rpx;
		  }
	  }
  }
  .bottomOperation{
	  position: fixed;
	  bottom: 0;
	  left: 0;
	  width: 100%;
	  height: 120rpx;
	  background-color: #fff;
	  z-index: 100;
	  box-shadow: 0px 0px 6px 1px rgba(0,0,0,0.16);
	  display: flex;
	  align-items: center;
	  justify-content: space-between;
	  .item{
		  width: 126rpx;
		  height: 60rpx;
		  background-color: #FFFFFF;
		  border-radius: 10rpx;
		  border: 1px solid #64B6A8;
		  color: #64B6A8;
		  font-size: 28rpx;
		  text-align: center;
		  line-height: 60rpx;
		  margin-right: 22rpx;
	  }
  }
  .HousCondition{
  	  height: 80rpx;
  	  display: flex;
  	  align-items: center;
  	  justify-content: space-between;
  	  .status{
  		  display: flex;
  		  align-items: center;
  		  .item{
  			  width: 96rpx;
  			  height: 48rpx;
  			  background: #FFFFFF;
  			  border-radius: 4rpx;
  			  border: 1px solid #64B6A8;
  			  margin-right: 10rpx;
  			  font-size: 24rpx;
  			  color: #64B6A8;
  			  text-align: center;
  			  line-height: 48rpx;
  		  }
  	  }
  }
  .housCategory{
	  height: 92rpx;
	  width: 100%;
	  display: flex;
	  align-items: center;
	  justify-content: space-between;
	  padding: 0 6rpx;
	  box-shadow: 0px 1px 6px 1px rgba(100,182,168,0.21);
	  .item{
		  width: 183rpx;
		  height: 80rpx;
		  border-radius: 12rpx;
		  display: flex;
		  flex-direction: column;
		  font-size: 28rpx;
		  justify-content: center;
		  align-items: center;
		  font-weight: 400;
	  }
	  .clickCur{
		  background-color: #64B6A8;
		  color: #fff;
	  }
  }
  .bot {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120rpx;
    background-color: #fff;
    z-index: 100;
    view {
      display: inline-block;
      position: absolute;
    }

    .bot_1 {
      left: 42rpx;
      top: 38rpx;
	  font-size: 34rpx;
    }

    .bot_2 {
      right: 272rpx;
      top: 38rpx;
	    font-size: 34rpx;
    }

    .bot_3 {
      width: 200rpx;
      height: 70rpx;
      background: #ffffff;
      border: 2rpx solid #64b6a8;
      color: #64b6a8;
      line-height: 68rpx;
      left: 304rpx;
      top: 25rpx;
      text-indent: 56rpx;
      border-radius: 36rpx;

      picker {
        height: 100%;
        width: 100%;

        .picker {
          left: 0;
          height: 100%;
          width: 100%;
          text-align: left;
          display: flex;
          position: relative;
          justify-content: center;
          text-indent: 0px;
        }
      }
    }

    .bot_3::before {
      position: absolute;
      top: 28rpx;
      right: 20rpx;
      content: "";
      border-color: #fff #fff #64b6a8 #fff;
      border-style: solid;
      border-width: 0rpx 8rpx 14rpx 8rpx;
      height: 0;
      width: 0;
    }

    .bot_4 {
      width: 190rpx;
      height: 70rpx;
      background: #64b6a8;
      color: #ffffff;
      line-height: 68rpx;
      left: 520rpx;
      top: 25rpx;
      text-indent: 56rpx;
      border-radius: 36rpx;

      picker {
        height: 100%;
        width: 100%;

        .picker {
          height: 100%;
          width: 100%;
          left: 0;
          text-align: left;
          display: flex;
          position: relative;
          justify-content: center;
          text-indent: 0px;
        }
      }
    }

    .bot_4::before {
      position: absolute;
      top: 28rpx;
      right: 20rpx;
      // content: "";
      border-color: #64b6a8 #64b6a8 #fff #64b6a8;
      border-style: solid;
      border-width: 0rpx 8rpx 14rpx 8rpx;
      height: 0;
      width: 0;
    }
  }

  .list {
    padding-top: 30rpx;
    margin-left: 30rpx;
    width: 720rpx;

    .tit {
      color: #333333;
      font-size: 36rpx;
      margin-bottom: 12rpx;
    }

    .li {
      position: relative;
      width: 96%;
      padding-bottom: 18rpx;
      margin-bottom: 34rpx;

      .xian {
        position: absolute;
        height: 2rpx;
        background-color: #e0e0e0;
        bottom: 0;
        right: 6rpx;
      }

      .biaoqian1 {
        position: absolute;
        width: 100rpx;
        height: 46rpx;
        font-size: 24rpx;
        font-weight: 600;
        line-height: 46rpx;
        color: #ffffff;
        z-index: 1;
        top: 0;
        text-align: center;
        background: #64b6a8;
        border-radius: 0px 0px 20rpx 0px;
      }

      .biaoqian2 {
        position: absolute;
        width: 100rpx;
        height: 46rpx;
        font-size: 24rpx;
        font-weight: 600;
        line-height: 46rpx;
        color: #ffffff;
        z-index: 1;
        top: 0;
        text-align: center;
        background: #999999;
        border-radius: 0px 0px 20rpx 0px;
      }

      .img1 {
        background-color: #f8f8f8;
        width: 300rpx;
        height: 200rpx;
      }

      .img2 {
        position: absolute;
        width: 300rpx;
        height: 200rpx;
      }

      .img3 {
        position: absolute;
        width: 300rpx;
        height: 200rpx;
      }

      .li_1 {
        position: relative;
        display: inline-block;
        vertical-align: top;
        margin-left: 24rpx;

        .tit {
          width: 100%;
          font-size: 34rpx;
          font-weight: 600;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2; //想要的行数
          -webkit-box-orient: vertical;
        }

        .neirong_1{
        	// width: 366rpx;
        	font-size: 24rpx;
        	color: #666666;
        	display: flex;
        	align-items: center;
        	.price{
        		color: red;
        		font-size: 30rpx;
        		font-weight: 600;
        	}
        	.neir_css{
        		flex: 1;
        		overflow: hidden;
        		text-overflow: ellipsis;
        		display: -webkit-box;
        		-webkit-line-clamp: 1; //想要的行数
        		-webkit-box-orient: vertical;
        	}
        	.neir_css:nth-child(2n){
        		margin-left: 10rpx;
        	}
        	.neir_css:nth-child(2n-1){
        		margin-right: 10rpx;
        	}
        }
      }
    }

    .li:last-child {
      border-bottom: 0rpx solid #e0e0e0;
    }
  }

  .view {
    position: relative;
    font-size: 26rpx;
    border: 0;
    color: #333333;
    margin-right: 0;

    image {
      position: absolute;
      width: 44rpx;
      height: 24rpx;
      top: 66rpx;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  .cur {
    color: #64b6a8;
    border: 0;
    transform: scale(1.1);
  }

  /deep/uni-checkbox .uni-checkbox-input {
    background-color: rgba(0, 0, 0, 0);
    border: 2rpx solid #999;
  }

  /deep/uni-checkbox .wx-checkbox-input,
  /deep/uni-checkbox .uni-checkbox-input {
    width: 50rpx;
    height: 50rpx;
  }

  /deep/.uni-checkbox-input-checked {
    background-color: #64b6a8 !important;
    border: 2rpx solid #64b6a8 !important;
  }

  /deep/ uni-checkbox::before {
    font-size: 40rpx;
    margin-top: -14rpx;
    right: 6rpx !important;
  }

  .down {
    height: 60rpx;
    line-height: 60rpx;
    // border-top: 2rpx solid #d0d0d0;
    text-align: center;
  }

  .none {
    text-align: center;

    image {
      width: 430rpx;
      margin-bottom: 16rpx;
    }

    view {
      height: 40rpx;
      line-height: 40rpx;
      color: #666;
    }
  }
</style>